#!/bin/sh
set -ex
. ${0%/*}/.dirset
path_o=${PRODADMDIR}/obj
path_f=${PRODADMDIR}/src/print

module load intel
module load openmpi_ib
module load netcdf

modfile="print_grid_file print_radiation_file print_spectra_file \
print_time read_grid_file read_grid_user read_radiation_file \
read_radiation_user read_spectra_file read_spectra_user \
read_time_user"

cd $path_o

for code in $modfile
do
   rm -f ${code}.f90 ${code}.o
   cp ${path_f}/${code}.f90 ${path_o}/${code}.f90
   mpif90 -c ${code}.f90
   rm -f ${code}.f90
done
